<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>变量</title>
</head>

<body>

</body>

</html>
<script>
    // var 有变量提升的风险 
    var a = 10;
    // 作用域相对安全
    let b = 20;
    a = 30;
    b = 40;
    window.console.log(a);
    window.console.log(b);
    // 数值型 布尔型 字符串 
    // undefined
</script>